<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>xFio - {{.title}}</title>
    <link href="/static/vendor/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="/static/css/style.css">
    <link href="/static/vendor/fontawesome/css/all.min.css" rel="stylesheet">
</head>
<body>
    <div class="sidebar">
        <div class="sidebar-header">
            <h3><span class="brand-icon" aria-hidden="true">
                <svg viewBox="0 0 24 24" role="img" focusable="false" class="xfio-logo-svg">
                    <circle cx="12" cy="12" r="11" class="disk" />
                    <path d="M13.5 2L6 14h5.2L10.5 22 18 10h-5.2L13.5 2z" class="bolt" />
                </svg>
            </span><span class="brand-word">x<span class="brand-f">F</span>io</span></h3>
            <p>分布式fio性能测试控制中心</p>
        </div>
        <div class="sidebar-nav">
            <nav class="nav flex-column">
                <a class="nav-link" href="/"><i class="fas fa-home"></i> 首页</a>
                <a class="nav-link active" href="/workers"><i class="fas fa-server"></i> 节点管理</a>
                <a class="nav-link" href="/test-cases"><i class="fas fa-file-code"></i> 测试用例</a>
                <a class="nav-link" href="/tasks"><i class="fas fa-tasks"></i> 任务管理</a>
                <a class="nav-link" href="/results"><i class="fas fa-chart-bar"></i> 结果分析</a>
            </nav>
        </div>
    </div>

    <div class="main-content">
        <div class="page-header">
            <h2><i class="fas fa-database me-2"></i> {{.title}}</h2>
            <button class="btn btn-primary" id="refreshWorkersBtn">
                <i class="fas fa-sync-alt me-1"></i>刷新
            </button>
        </div>

        <div class="row mb-4">
            <div class="col-md-3">
                <div class="card text-center bg-primary text-white">
                    <div class="card-body">
                        <h5 id="totalWorkers">0</h5>
                        <p class="mb-0">节点总数</p>
                    </div>
                </div>
            </div>
            <div class="col-md-3">
                <div class="card text-center bg-success text-white">
                    <div class="card-body">
                        <h5 id="onlineWorkers">0</h5>
                        <p class="mb-0">在线节点</p>
                    </div>
                </div>
            </div>
            <div class="col-md-3">
                <div class="card text-center bg-warning text-white">
                    <div class="card-body">
                        <h5 id="offlineWorkers">0</h5>
                        <p class="mb-0">离线节点</p>
                    </div>
                </div>
            </div>
            <div class="col-md-3">
                <div class="card text-center bg-info text-white">
                    <div class="card-body">
                        <h5 id="healthyWorkers">0</h5>
                        <p class="mb-0">健康节点</p>
                    </div>
                </div>
            </div>
        </div>

        <div class="card">
            <div class="card-header d-flex justify-content-between align-items-center">
                <h5 class="mb-0"><i class="fas fa-server text-primary"></i> 节点管理</h5>
                <div class="d-flex gap-2">
                    <button class="btn btn-outline-danger" id="batchDeleteBtn" disabled>
                        <i class="fas fa-trash-alt"></i> 批量删除
                    </button>
                </div>
            </div>
            <div class="card-body">
                <div class="table-responsive">
                    <table class="table table-striped table-hover" id="workersTable">
                        <thead class="table-dark">
                            <tr>
                                <th><input type="checkbox" id="selectAll" title="全选"></th>
                                <th>名称</th>
                                <th>ID</th>
                                <th>IP地址</th>
                                <th>状态</th>
                                <th>fio版本</th>
                                <th>注册时间</th>
                                <th>操作</th>
                            </tr>
                        </thead>
                        <tbody>
                                <!-- 节点数据将通过JavaScript动态加载 -->
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>

    <footer class="footer bg-light mt-5 py-4">
        <div class="container">
            <div class="row">
                <div class="col-12 text-center">
                    <p class="mb-0">&copy; 2025 xfio - 分布式fio性能测试系统</p>
                </div>
            </div>
        </div>
    </footer>

    <script src="/static/vendor/bootstrap.bundle.min.js"></script>
    <script src="/static/js/workers.js"></script>
</body>
</html>